.tool-panel {
  position: fixed;
  right: 350px; /* 聊天框宽度，紧贴聊天框左侧 */
  top: 0;
  width: 233px; /* 聊天框宽度的三分之二 */
  height: 100vh; /* 与聊天框同高 */
  background: white;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 1500;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tool-panel.closed {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.tool-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.tool-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.tool-panel-header h3 {
  margin: 0;
  font-size: 14px;
  color: #333;
  font-weight: 600;
}

.tool-panel.closed .tool-panel-header h3 {
  display: none;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: #666;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.toggle-btn:hover {
  background: #e0e0e0;
}

.tool-panel-content {
  height: calc(100vh - 49px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
}

.search-section {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: #2196f3;
}

.category-section {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.category-tab {
  padding: 4px 8px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 12px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.category-tab:hover {
  background: #f0f0f0;
}

.category-tab.active {
  background: #2196f3;
  color: white;
  border-color: #2196f3;
}

.tools-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.tool-item {
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.tool-item:hover {
  border-color: #2196f3;
  box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1);
  transform: translateY(-1px);
}

.tool-item:active {
  transform: translateY(0);
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tool-name {
  font-weight: 600;
  font-size: 12px;
  color: #333;
}

.tool-source {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.05);
}

.tool-description {
  font-size: 11px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 4px;
}

.tool-category {
  font-size: 10px;
  color: #888;
  font-style: italic;
}

.no-tools {
  text-align: center;
  color: #999;
  font-size: 12px;
  padding: 20px;
}

/* 拖拽状态 */
.tool-item[draggable="true"] {
  cursor: grab;
}

.tool-item[draggable="true"]:active {
  cursor: grabbing;
}

/* 滚动条样式 */
.tools-list::-webkit-scrollbar {
  width: 6px;
}

.tools-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.tools-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.tools-list::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .tool-panel.open {
    width: 280px;
  }
  
  .category-tabs {
    justify-content: flex-start;
  }
  
  .category-tab {
    font-size: 9px;
    padding: 3px 6px;
  }
}
